package user;

import books.BookList;
import operation.*;

import java.util.Scanner;

public class AdminUser extends User{
    public AdminUser( ){

      this.iOperations = new IOperation[]{
                new ExitOperation(),
                new AddOperation() ,
                new ReWorkOperation(),
                new DelOperation(),
                new ShowOperation()
        };
    }


    @Override
    public int menu() {

        Scanner scan = new Scanner(System.in) ;
        while(true){
            System.out.println("================");
            System.out.println("1. 添加图书");
            System.out.println("2. 修改图书");
            System.out.println("3. 删除图书");
            System.out.println("4. 查看图书");
            System.out.println("0. 退出系统");
            System.out.println("请输入->");
            int tmp = scan.nextInt() ;
            if(tmp <=4 && tmp >=0){
                return tmp ;
            }else {
                System.out.println("输入错误请重新输入");
            }
        }

    }
}
